package com.lsfb.signln.Statistics.WithoutAddress;

import android.content.Context;
import android.widget.ProgressBar;

import com.lsfb.signln.R;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonRecycAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolderRecyc;

import java.util.List;

/**
 * Created by Administrator on 2018/3/2 0002.
 */

public class OutAreaInfoAdapter extends CommonRecycAdapter<OutAreaInfoBean.DeparStatisticsVOBean.ListBean> {
    private Context mContext;
    private int count;

    public void setCount(int count) {
        if (count == 0) {
            count = 1;
        }
        this.count = count;
    }

    public OutAreaInfoAdapter(Context context, List<OutAreaInfoBean.DeparStatisticsVOBean.ListBean> list, int layoutId) {
        super(context, list, layoutId);
        mContext = context;
    }

    @Override
    public void convert(ViewHolderRecyc holder, OutAreaInfoBean.DeparStatisticsVOBean.ListBean model) {
        //城市名称
        holder.setText(R.id.item_text_depart, model.getName());
        ProgressBar progressBar = holder.getView(R.id.aty_nutrition_pb_dangu);
        progressBar.setMax(count);
        int progress = Integer.parseInt(model.getCount()) / count;
        progressBar.setProgress(progress);
        //外勤地区数
        holder.setText(R.id.item_text_depart_num, model.getCount());
    }
}
